<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title>Student List</title>
        <script type="text/javascript" language="JavaScript1.2" src="stm31.js"></script>        
    </head>

    <body>
        <table width="854" border="0" cellspacing="0" cellpadding="0" align="center">

            <tr>
                <td width="854" bgcolor="#FFFFCC">
                    <%@ page import="java.io.*"%>
                    <%@ page import="java.util.*"%>
                    <%@ page import="java.sql.*"%>
                    <%@ page import="com.myapp.struts.dao.*"%>
                    <%@ page import="com.myapp.struts.beans.*"%>
                    <%
        ArrayList al = (ArrayList) request.getAttribute("AL");
        System.out.println("al at Invoice LIST :%" + al);
        if (al != null) {
            Iterator it = al.iterator();

                    %>
                    <form action="./JvEdit" method="get" name="invlist">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td height="40" colspan="7"><div align="center" class="login">Journal Voucher List </div>		  </td>
                            </tr>
                            <tr>
                                <td> </td>
                                <td colspan="6"><input name="Add" type="submit" class="tabledata" value="Add" />
                                    <input name="View" type="submit" class="tabledata" value="View" />
                                    <input name="Edit" type="submit" class="tabledata" value="Edit" />
                                    <input name="Delete" type="submit" class="tabledata" value="Delete" />   </td>   </tr>
                            <tr>
                                <td width="31">&nbsp;</td>
                                <td width="178">&nbsp;</td>
                                <td width="125">&nbsp;</td>
                                <td width="125">&nbsp;</td>
                                <td width="101">&nbsp;</td>
                                <td width="139">&nbsp;</td>
                                <td width="155">&nbsp;</td>
                            </tr>

                            <tr>
                                <td bgcolor="#7DDF90" class="columnname">&nbsp;</td>
                                <td bgcolor="#7DDF90" class="columnname"><div align="left">JournalVoucherNo</div></td>
                                <td bgcolor="#7DDF90" class="columnname"><div align="left">JvDate</div></td>
                                <td bgcolor="#7DDF90" class="columnname"><div align="center">AccountHead</div></td>
                                <td bgcolor="#7DDF90" class="columnname"><div align="center">Debit	</div></td>
                                <td bgcolor="#7DDF90" class="columnname"><div align="left">Credit</div></td>
                                <td bgcolor="#7DDF90" class="columnname"><div align="center">TotalAmount</div></td>
                            </tr>
                            <tr>
                                <% while (it.hasNext()) {
                            JvBean jb = (JvBean) it.next();

                            String jvno = jb.getJv_No();
                            String jvdate = jb.getJv_Date();
                            String account = jb.getAccount_Head();
                            String debit = jb.getDebit_Amount();
                            String credit = jb.getCredit_Amount();
                            String tamt = jb.getTotal_Amount();

                            System.out.println("jvdate........." + jvdate);

                            String[] jnd = jvdate.split("/");
                            String jodate = jnd[2] + "-" + jnd[1] + "-" + jnd[0];

                                %>
                                <td height="20" class="tabledata">
                                    <input name="cbox" type="checkbox" class="tablerow"  value="<%=jvno%>" />
                                </td>
                                <td align="center" class="tabledata"><%=jvno%></td>
                                <td align="center" class="tabledata"><%=jodate%></td>
                                <td align="left" class="tabledata"><%=account%></td>
                                <td align="right" class="tabledata"><%=debit%></td>
                                <td align="right" class="tabledata"><%=credit%></td>
                                <td align="right" class="tabledata"><%=tamt%></td>
                            </tr>

                            <%}%>
                            <%}%>
                        </table>
                    </form>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p></td>
            </tr>
        </table>

    </body>
</html>
